#ifndef ParseHelper_h
#define ParseHelper_h

#include <variant_string.h>
#include <sstream>

namespace ParseHelper
{
	class TemplateParse
	{
	public:
		//--------------------------------------------------------------------------------------
		template<typename T> static std::string2 _parseToString(T value)
		{
			std::string2 output;

			std::stringstream ss;
			ss << value;
			ss >> output;

			return output;
		}

		//--------------------------------------------------------------------------------------
		template<> static std::string2 _parseToString(bool value)
		{
			if(value)
				return "True";
			else
				return "False";
		}
	
		//---------------------------------------------------------------------------------------
		template<typename T> T static _parseFromString(const std::string2& value)
		{
			T output;

			std::stringstream ss;
			ss << value;
			ss >> output;

			return output;
		}

		//---------------------------------------------------------------------------------------
		template<> static bool _parseFromString(const std::string2& value)
		{
			throw;
			//if( 0 == value.compare( "True" ) )
			//{
			//	return true;
			//}
			//else if( 0 == value.compare( "true" ) )
			//{
			//	return true;
			//}
			//else
			//{
			//	return false;
			//}
		}
	};
}

#endif